{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{%block content%}

{%for entry in entries %}
{%ifequal entry.side 1%}
<div class="clearfix" id="index_entry">
	<div class="index_entry_author" style="float:left;">
		<img src="{{entry.image}}" />
		<p>{{entry.author}}</p><p class="index_entry_time">{{entry.date|date:"Y-m-d" }}</p><p class="index_entry_time">{{entry.date|date:"G:i:s"}}</p>
	</div>
	<div class="index_entry_content" style="float:right;" onmouseover="ShowContent(this)" onmouseout="HideContent(this)">
		{%ifequal entry.author state%}
			<a href="../edit{{entry.uid}}">编辑</a>|<a href="../delete{{entry.uid}}">删除</a><hr />
		{%endifequal%}
		{{entry.content}}
	</div>
</div>
{%else%}
<div class="clearfix" id="index_entry">
	<div class="index_entry_content" style="float:left;" onmouseover="ShowContent(this)" onmouseout="HideContent(this)">
		{%ifequal entry.author state%}
			<a href="../edit{{entry.uid}}">编辑</a>|<a href="../delete{{entry.uid}}">删除</a><hr />
		{%endifequal%}
		{{entry.content}}
	</div>
	<div class="index_entry_author" style="float:right;">
		<img src="{{entry.image}}" />
		<p>{{entry.author}}</p><p class="index_entry_time">{{entry.date|date:"Y-m-d" }}</p><p class="index_entry_time">{{entry.date|date:"G:i:s"}}</p>
	</div>
</div>
{%endifequal%}
{%endfor%}
{% if state %}
<form method="post">
	<textarea cols="50" rows="10" name="content"></textarea>
	<input type="submit" value="发表" />
</form>
{%endif%}
<br />

{%endblock%}